@extends('default.layouts.adminPublic')
@section('title', '招聘会报名列表')
@section('headcss')
    @parent
    <link rel="stylesheet" href="{{asset('/default/css/admin/indexList.css')}}">
    @endsection
    @section('content')
            <!--导航开始-->
    <div class="crumb_warp">
        <i class="fa fa-home"></i> <a href="{{url('admin/job_fair')}}">首页</a> &raquo; 招聘会报名列表
    </div>
    <!--导航结束-->
    <!--结果集标题与导航组件 开始-->

    <div class="con">
        <div class="conMain">
            <div class="result_wrap">
                <div class="search">
                    <form name="Formso" id="Formso" action="{{url('admin/signup/'.$id)}}" method="post">
                        {{csrf_field()}}
                        <span>关键字：</span>
                        <span><input name="keyword" class="keyword" id="keyword" placeholder="请输入企业名称"
                                     type="text"></span>
                        <span><input name="submit" class="skeyword" value="搜索" type="submit"></span>
                    </form>
                </div>
                <div class="message" style="margin-top: 15px;">
                    <p><span style="margin-right: 20px; font-size: 15px;"><a href="{{url('admin/job_fair_list')}}"><i
                                        class="fa fa-mail-reply"></i>招聘会列表</a></span>
                        <span>目前共查找到<strong>{{$signup->total()}}</strong>个报名记录！且每页显示报名记录{{$signup->perPage()}}
                            个。</span>
                    </p>
                </div>
            </div>
            <div class="manage">
                @include('flash::message')
            </div>
            <div class="conInfo">
                <form name="thisForm" id="thisForm" action="" method="post">
                    {{csrf_field()}}
                    <div class="conList" id="conList">
                        <dl class="one">
                            <dt><input name="selectall" type="checkbox" value="1" onclick="CheckAll(this)"/></dt>
                            <dd class="signup1">企业名称</dd>
                            <dd class="signup2">联系人</dd>
                            <dd class="signup3">联系电话</dd>
                            <dd class="signup4">报名类型</dd>
                            <dd class="signup4">状态</dd>
                            <dd class="signup4">操作</dd>
                        </dl>
                        @if(count($signup) > 0 )
                            @foreach($signup as $v)
                                <dl id="list{{$v->id}}">
                                    <dt><input name="selected_id[]" type="checkbox" value="{{$v->id}}"/></dt>
                                    <dd class="signup1">{{str_limit($v->company,30)}}</dd>
                                    <dd class="signup2">{{str_limit($v->contact_person,16)}}</dd>
                                    <dd class="signup3">{{str_limit($v->phone,44)}}</dd>
                                    <dd class="signup4"> @if(empty($v->com_uid))游客报名@else企业报名@endif</dd>
                                    <dd class="signup4">{{str_limit($v->haved,44)}}</dd>
                                    <dd class="signup4">
                                        <span class="signup_ok"><a>通过</a></span>
                                    </dd>
                                </dl>
                            @endforeach
                        @else
                            <div class="nullcon">对不起！没有报名的记录！</div>
                        @endif
                        <dl class="last">
                            <dt>
                                <input name="selectall" id="selectall" type="checkbox" value="1"
                                       onclick="CheckAll(this)"/>
                                <label for="selectall">全选</label>
                            </dt>
                            <dd class="p6"><a onclick="showconfirm('{{url('admin/signup_batch_ok/'.$id)}}','2')">通过</a></dd>
                        </dl>
                    </div>
                </form>
                <div class="page_list" style="width: 100%; float: left; margin-top:15px;">
                    {!! $signup->links() !!}
                </div>
            </div>

            <div class="stopper" style="margin-top:10px; border-top: 1px solid #e5e5e5"></div>
        </div>
    </div>
    <!--结果集标题与导航组件 结束-->
@endsection

@section('footerjs')
    @parent
    <script type="text/javascript" src="{{asset('/default/js/admin/jobfair_and_signup.js')}}"></script>
    <script>
        $(function(){
            @if($signup->count() > 0 )
            @foreach($signup as $v)
            //单条下架投诉
            $('#conList').find("#list" + '{{$v->id}}').find('.signup_ok a').click(function(){
                layer.confirm('您确定要通过这个企业吗？', {
                    btn: ['确定', '取消'] //按钮
                }, function () {
                    $.post("/admin/signup_ok/{{$id}}",{'selected_id':'{{$v->id}}','_token':"{{csrf_token()}}"},function (data) {
                        if(data.status==0){
                            layer.msg(data.msg, {icon: 6,time:1500});
                            window.location.href = "{{url('/admin/signup/'.$id)}}";
                        }else{
                            layer.msg(data.msg, {icon: 5,time:1500});
                        }
                    });
                });
            });
            @endforeach
            @endif
        });
    </script>
@endsection